package com.myrock.zlbandy.gorock.rock.z;

import android.media.Image;
import android.os.Parcel;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.style.RelativeSizeSpan;
import android.text.style.SubscriptSpan;

/**
 * Created by zlbandy on 2017/9/9.
 */

public abstract class MyRock {

    public static SpannableStringBuilder String2Formula(String formula){
        SpannableStringBuilder msp = new SpannableStringBuilder(formula);
        for(int i=0;i<formula.length();i++){
            char a = formula.charAt(i);
            if(a>='0' && a<='9'){
                msp.setSpan(new RelativeSizeSpan(.7f), i, i+1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            }
        }
        return  msp;

    }



}
